<!DOCTYPE html>

<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>节点操作</title>
    </head>
    <body>

        <div class="wrapper">
            <div class="inner first">
                <b>朱</b>
                <strong>亚雯</strong>
            </div>
            <div class="inner second">
                <b>朱</b>
                <strong>亚红</strong>
            </div>
            <div class="inner third">
                <b>郑</b>
                <strong>娅婷</strong>
            </div>
        </div>

        <script type="text/javascript">
            let node = document.querySelector( '.wrapper>.second' );
            if( node.hasChildNodes() ){
                let childs = node.childNodes ;
                console.log( childs );
            }

            let root = node.getRootNode();
            console.log( root );

            console.log( root.childNodes );

            let b = document.querySelector( '.wrapper .second b' );
            console.log( node.contains( b ) );

            let x = document.querySelector( '.wrapper .first b' );
            let y = document.querySelector( '.wrapper .second b' );

            console.log( x.isEqualNode( y ) );
            console.log( x.isSameNode( y ) );

        </script>

    </body>
</html>